import { request } from '@/request/request'
import {
  AdminLoginApiDataType,
  AdminLoginApiResType,
  GetAdminCaptchaApiResType,
  GetAdminInfoApiResType,
} from '#/login/loginType'

export const adminLoginApi = (
  data: AdminLoginApiDataType
): PromiseRes<AdminLoginApiResType> => request.post('/admin/login', data)

export const getAdminInfoApi = (): PromiseRes<GetAdminInfoApiResType> =>
  request.get('/admin/info')

export const getAdminCaptcha = (): PromiseRes<GetAdminCaptchaApiResType> =>
  request.get('/admin/captcha')
